Repository navigation
fix(device): select the only booted iPhone or iPad before ranking iPhones above iPads - #5076
Merged
thymikee merged 1 commit intoNov 24, 2026
Conversation
…ones above iPads An iPad session with several shut-down iPhone simulators failed every command without a selector: the iPhone rank dropped the booted iPad before the booted check, so the shut-down iPhones tied and selection refused with AMBIGUOUS_MATCH. iPhones and iPads of one kind now share a tier, and its only booted member wins. With none or several booted, an iPhone still ranks above an iPad. Simulators over hardware and handhelds over TV, desktop, and watch are unchanged.
Member
|
Thanks for the fix. Reviewed at f8ccebd: the change selects the only booted iPhone or iPad before ranking iPhones above iPads, and the code trace shows no problem. CI is green on this commit, with 2 checks and none failing. The local provider-revyl runtime.test.ts failure (a 503 health timeout) is outside the diff, which touches only the kernel device.ts and device.test.ts. No conflicts. Not verified here: the kernel tests and the live Mac CLI check were not run, and both are taken from the PR body and the code trace. Nothing else needs to change before merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
With one booted iPad simulator and three shut-down iPhones, iOS commands without a selector fail with
AMBIGUOUS_MATCH. Apple ranking drops the iPad before boot state is considered.This change puts iPhones and iPads of the same kind (simulator or hardware) in one tier. The only booted handheld in the best tier wins; otherwise, the existing iPhone-over-iPad ranking applies.
Simulators still rank above hardware, and handhelds above TV, desktop, and watch. A booted iPhone plus a booted iPad still selects the iPhone. Equal matches still require an explicit selector. The ranking documentation is updated.
Before / after
For
resolveDevice(devices, { platform: 'ios' }), with one booted iPad simulator and three shut-down iPhone simulators:8a29aea9a: throwsAMBIGUOUS_MATCH: “3 devices match this request equally; select one explicitly.”f8ccebdb2: returns the booted iPad.A live Mac check with one booted iPad (A16, iOS 26.5) and 10 shut-down iPhones confirmed the same behavior. Running
node bin/agent-device.mjs capabilities --platform ios --jsonwithout a selector selects the booted iPad at head (exit 0). Base throwsAMBIGUOUS_MATCH: “10 devices match this request equally; select one explicitly.” (exit 1).Validation
Tested head
f8ccebdb2against base8a29aea9a.check:affected --runpassed format, lint, typecheck, layering, fallow, build, and vitest-related checks (441 tests). It stopped at the unit lane on the Revyl failure described below, so daemon-wire-compat did not run within the gate.check:daemon-wire-compatpassed with the protocol unchanged,test:smokepassed all 76 tests, andcheck:tmpdir-leakswas clean.The only unit failure was
packages/provider-revyl/src/runtime.test.ts: “Revyl answers health with 503 until the worker attaches, and the start keeps polling,” which timed out after 5,000 ms. It fails the same way on base and is unrelated to this change. The gate and full unit suite therefore remain failing; how to handle that pre-existing failure for merge readiness is up to maintainers.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.